package com.atguigu.springtestdemo.service.impl;

import com.atguigu.springtestdemo.bean.TCustomer;
import com.atguigu.springtestdemo.bean.Test;
import com.atguigu.springtestdemo.mapper.TCustomerMapper;
import com.atguigu.springtestdemo.service.TCustomerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TCustomerServiceImpl extends ServiceImpl<TCustomerMapper, Test/*TCustomer*/> implements TCustomerService {

    @Autowired
    TCustomerMapper tCustomerMapper;

    @Override
    public Test/*TCustomer*/ selectCustomer(Integer id) {
        System.out.println(id);
        System.out.println(tCustomerMapper.selectById(id));
        return tCustomerMapper.selectById(id);
    }

    @Override
    public void insertCustomer(Test test/*TCustomer customer*/) {
        tCustomerMapper.insert(test/*customer*/);
    }

    @Override
    public void updateCustomer(Test test/*TCustomer customer*/) {
        tCustomerMapper.updateById(test/*customer*/);
    }

    @Override
    public void deleteCustomer(Integer id) {
        tCustomerMapper.deleteById(id);
    }
}
